//
//  WFSpaceCell.m
//  WeiFang
//
//  Created by WeiFang on 2022.
//  Copyright © 2022 WeiFang. All rights reserved.
//

#import "WFSpaceCell.h"

@implementation WFSpaceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setData:(id)data delegate:(id)delegate {
    
    if ([data isKindOfClass:[NSDictionary class]]) {
        if ([data[@"data"] isKindOfClass:[WFSpaceCellModel class]]) {
            WFSpaceCellModel *model = data[@"data"];
            if (model.bagroundColor) {
                self.contentView.backgroundColor = model.bagroundColor;
            } else {
                self.contentView.backgroundColor = [UIColor clearColor];
            }
        }
    }
}

@end


#pragma mark - Model

@implementation WFSpaceCellModel

+ (WFSpaceCellModel *)ittemModelWithBagroundColor:(UIColor *)bagroundColor {
    WFSpaceCellModel *model = [WFSpaceCellModel new];
    model.bagroundColor = bagroundColor;
    return model;
}

@end
